package com.example.javabasic.thread.classtwo.workthread.listner;

public class Test {

   public static StackTraceElement[] stackTrace;
    public static void main(String[] args) {
        new Test().a();
        for (int i = stackTrace.length - 1; i >= 0; i--) {
            StackTraceElement s = stackTrace[i];
            System.out.println("类名:"+s.getClassName()+" 方法名:"+s.getMethodName()+" 行号:"+s.getLineNumber());

        }
    }
    public void a(){
        b();
    }
    public void b(){
        c();
    }
    public void c(){
        d();
    }
    public void d(){
        stackTrace = Thread.currentThread().getStackTrace();
    }
}
